package com.alibaba.dubbo.remoting.msgcodec;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.alibaba.dubbo.remoting.MessageDecode;
import com.alibaba.dubbo.remoting.MessageEncodeRegistry;

public class DES3Decode extends DES3CodecBase implements MessageDecode {
	public DES3Decode(){
		super();
	}

	@Override
	public int decode(InputStream in, OutputStream out/*, MessageEncodeRegistry registry*/) throws IOException {
		try {
			int ret = decrypt(in, out, this.getKey(), this.getIv());
			//registry.appendEncode("des3");
			return ret;
		} catch (Exception e) {
			throw new IOException(e);
		}
	}
}
